package shuixian.jing.discuz.activity;

import org.apache.http.client.HttpClient;


public class HttpTest {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		
		
		/*BasicClientCookie basicClientCookie = new BasicClientCookie("name", "value");
		basicClientCookie.setVersion(0);
		basicClientCookie.setDomain(".baidu.com");
		basicClientCookie.setPath("/");
		basicClientCookie.setSecure(true);
		//精确设置由服务器发送的数据
		basicClientCookie.setAttribute(ClientCookie.VERSION_ATTR, "1");
		
		
		HttpClient client = new DefaultHttpClient();
		//对每个默认的，强制cookie策略
		client.getParams().setParameter(ClientPNames.COOKIE_POLICY, CookiePolicy.RFC_2965);
		HttpGet httpGet = new HttpGet("Http://baidu.com");
		//对请求覆盖默认策略
		httpGet.getParams().setParameter(ClientPNames.COOKIE_POLICY, CookiePolicy.BROWSER_COMPATIBILITY);
		
		
		CookieSpecFactory csf = new CookieSpecFactory() {
			
			@Override
			public CookieSpec newInstance(HttpParams params) {
				return new BrowserCompatSpec(){

					@Override
					public void validate(Cookie cookie, CookieOrigin origin)
							throws MalformedCookieException {
						// TODO Auto-generated method stub
						//这样相当简单
						
					}

				};
			}
		};
		*/
		
		
	}	

}
